<template>
	<view class="content">
		<view class="login-logo">

		</view>
		<view class="login-title">

		</view>
		<view class="login-man">

		</view>
		<!-- <view class="chuizhijuzhong m320">
			<view class="login-input-bg">
				<input type="text" class="shurukuang" placeholder="输入WWID" v-model.trim="userinfo.wwid"
					placeholder-class="shurukuang-tips">
			</view>

			<view class="btn-login-queding" @tap="login">
			</view>
		</view> -->

		<view class="chuizhijuzhong m320">
			<view class="toupiao" @tap="toupiao">
			</view>
			<view class="paihangbang" @tap="paihangbang">
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo: {
					wwid: '',
					password: '',

				},
				touxiang: '',
				nickName: '',
				code: '',
				userInfo: {}
			}
		},
		onShow() {
			if (uni.getStorageSync('openid')) {
				uniCloud.callFunction({
					name: 'get-userinfo',
					data: {
						openid: uni.getStorageSync('openid')
					},
					success: (res) => {
						console.log(res)
						uni.setStorageSync('userInfo', res.result.data[0])
					}
				})
			} else {
				uni.navigateTo({
					url: '../index/index'
				})
			}
		},
		methods: {

			/* login() {
				uni.showLoading({
					title: '登录中···',
					mask: true
				})
				//转换密码为正数
				this.userinfo.password = Number(this.userinfo.password)
				uniCloud.callFunction({
					name: 'login',
					data: this.userinfo
				}).then(res => {
					uni.hideLoading()
					console.log('登陆后返回', res)
					if (res.result.status == 0) {
						uni.showToast({
							title: res.result.msg,
							mask: true,
							icon: 'none'
						})
						this.userinfo = {
							wwid: '',
							password: ''
						}
					} else {
						console.log('登陆成功')
						uni.setStorageSync('LOGIN', res.result.data[0])
						uni.navigateTo({
							url: '../main/main'
						})
					}
				})
			}, */
			toupiao() {
				uni.navigateTo({
					url: '../main/main'
				})
				/* if (uni.getStorageSync('openid')) {
					uni.navigateTo({
						url: '../main/main'
					})
				} else {
					uni.showToast({
						title: '请先登录',
						icon: 'none',
						mask: true
					})
				} */

			},
			paihangbang() {
				uni.navigateTo({
					url: '../list/list'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background: url('@/static/bg.jpg') no-repeat center top;
		background-size: 100% auto;
	}

	.login-logo {
		width: 750rpx;
		height: 520rpx;
		background: url('@/static/login-logo.png') no-repeat center center;
		background-size: 100% 100%;
		// margin-top: 136rpx;
	}

	.login-title {
		width: 610rpx;
		height: 160rpx;
		background: url('@/static/login-title.png') no-repeat center center;
		background-size: 100% 100%;
		// margin-top: -290rpx;
	}

	.login-man {
		width: 712rpx;
		height: 582rpx;
		background: url('@/static/login-man.png') no-repeat center center;
		background-size: 100% 100%;
		// margin-top: -170rpx;
	}

	.login-input-bg {
		width: 386rpx;
		height: 108rpx;
		background: url('@/static/login-input-bg.png') no-repeat center center;
		background-size: 100% auto;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		// margin-top: -170rpx;
	}

	.btn-login-queding {
		width: 154rpx;
		height: 94rpx;
		background: url('@/static/btn-login-queding.png') no-repeat center center;
		background-size: 100% auto;
		margin-top: 12rpx;
	}

	.chuizhijuzhong {
		display: flex;
		flex-direction: row;
		align-items: center;
		width: 546rpx;
		justify-content: space-between;

	}

	.shurukuang {
		width: 340rpx;
		height: 60rpx;
		font-size: 14px;
		color: #fff;
	}

	.shurukuang-tips {
		color: aliceblue;
		font-size: 14px;
	}

	.m320 {
		// margin-top: -150rpx;
	}

	.m120 {
		margin-top: 30rpx;
	}

	.toupiao {
		width: 302rpx;
		height: 72rpx;
		background: url('@/static/btn-login-call.png') no-repeat center center;
		background-size: 100% 100%;
		margin-left: 10rpx;
	}

	.paihangbang {
		width: 222rpx;
		height: 72rpx;
		background: url('@/static/btn-login-paihang.png') no-repeat center center;
		background-size: 100% 100%;
	}
</style>
